<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>档案管理系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/static/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/static/dist/css/skins/all-skins.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="/static/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/layer/theme/default/layer.css">
    <link rel="stylesheet" href="/static/css/viewer.min.css">
    <link rel="stylesheet" href="/static/webCss/ckwsda.css?v=shujubuwqd12138">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/static/plugins/ie9/html5shiv.min.js"></script>
    <script src="/static/plugins/ie9/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue" style="font-size: medium">


<div class="content " id="yhgl">
    <div class="row">
        <div class="modal" id="jydaDiv" data-backdrop="static">
            <!--<div id="tree2">-->
                <!--<img id="tree2Img" dataUrl="http://211.159.186.65:33333/api/fj/downloadFj?type=1&fileName=1590982068983.jpg">-->
            <!--</div>-->
            <div class="modal-dialog" style="width: 1100px;height: 600px">
                <!--<span class="btn btn-primary" data-original=""></span>-->
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">档案查看</h4>
                    </div>
                    <div class="modal-body row">
                        <div class="col-xs-5" style="overflow:auto;height: 600px">
                            <p3>材料信息</p3>
                            <!--<div id="tree"></div>-->
                            <div class=" text-center" style="padding: 10px">
                                <!--<button type="button" class="btn btn-primary btn-xs" @click="printWj">打印选中文件</button>-->
                                <button type="button" class="btn btn-primary btn-xs" @click="downloadWj">下载选中文件</button>
                            </div>
                        </div>
                        <div class="col-xs-5">
                            <p3>档案信息</p3>
                        </div>
                        <div class="col-xs-7" style="overflow:auto;height: 900px">
                            <div class="box-body row">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal" id="jydawsDiv" data-backdrop="static">

            <div class="modal-dialog" style="width: 1100px">
                <!--<span class="btn btn-primary" data-original=""></span>-->
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">档案查看</h4>
                    </div>
                    <div class="modal-body row">
                        <div class="col-xs-5" style="overflow:auto;height: 500px">
                            <p3>材料信息</p3>
                            <!--<div id="tree5"></div>-->
                            <div class=" text-center" style="padding: 10px">
                                <!--<button type="button" class="btn btn-primary btn-xs" @click="printWj">打印选中文件</button>-->
                                <button type="button" class="btn btn-primary btn-xs" @click="downloadWj">下载选中文件</button>
                            </div>
                            <!--<button type="button" onclick="printWj">打印</button>-->
                        </div>
                        <div class="col-xs-7">
                            <div class="box-body row">
                                <div class="nav-tabs-custom">
                                    <!-- Tabs within a box -->
                                    <ul class="nav nav-tabs pull-right">
                                        <!--<li class="active"><a href="#revenue-chart" data-toggle="tab">Area</a></li>-->
                                        <!--<li><a href="#sales-chart" data-toggle="tab">Donut</a></li>-->
                                        <li class="pull-left" style="color: #00a7d0"><i class="fa fa-inbox"></i> 基本信息</li>
                                    </ul>
                                    <div class="tab-content no-padding">
                                        <!-- Morris chart - Sales -->
                                        <div class="chart tab-pane active" style="position: relative">
                                            <div class="row">
                                                <div class="form-group col-xs-6">
                                                    <label>档案类型</label>
                                                    <input name="typeName" type="text" class="form-control input-sm" v-model="wsxx.typeName"
                                                           readonly>
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>案卷题名</label>
                                                    <input readonly v-model="wsxx.wjmc" name="wjmc" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>档案编号</label>
                                                    <input readonly name="dabh" v-model="wsxx.dabh" type="text"
                                                           class="form-control input-sm">
                                                </div>

                                                <div class="form-group col-xs-6">
                                                    <label>单位名称</label>
                                                    <input readonly v-model="wsxx.dwmc" name="dwmc" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>年份</label>
                                                    <input readonly v-model="wsxx.nf" name="nf" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>时间</label>
                                                    <input readonly v-model="wsxx.sj" name="sj" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>页号</label>
                                                    <input readonly v-model="wsxx.yh" name="yh" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>页数</label>
                                                    <input readonly v-model="wsxx.ys" name="ys" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                                <div class="form-group col-xs-6">
                                                    <label>总盒号</label>
                                                    <input readonly v-model="wsxx.zhh" name="zhh" type="text"
                                                           class="form-control input-sm">
                                                </div>
                                            </div>

                                        </div>
                                        <!--<div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;"></div>-->
                                    </div>
                                </div>
                                <div class="nav-tabs-custom">
                                    <!-- Tabs within a box -->
                                    <ul class="nav nav-tabs pull-right">
                                        <!--<li class="active"><a href="#revenue-chart" data-toggle="tab">Area</a></li>-->
                                        <!--<li><a href="#sales-chart" data-toggle="tab">Donut</a></li>-->
                                        <li class="pull-left" style="color: #00a7d0"><i class="fa fa-inbox"></i>备注</li>
                                    </ul>
                                    <div class="tab-content no-padding">
                                        <!-- Morris chart - Sales -->
                                        <div class="chart tab-pane active" style="position: relative">
                                            <div class="row">
                                                <div class="form-group col-xs-12">
                                                    <label>备注</label>
                                                    <textarea readonly v-model="wsxx.bz" name="qzh" type="text"
                                                              class="form-control input-sm">
                                                    </textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="tree3">
        <img id="tree3Img" dataUrl="http://211.159.186.65:33333/api/fj/downloadFj?type=1&fileName=1590982068983.jpg">
    </div>
    <div class="row">
        <div class="col-xs-3 left">
            <div class="row" style="height: 54px;border-bottom: 1px solid #E0E0E0">
                <label class="col-xs-4" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px">档案材料</label>
                <div class="btn-group col-xs-offset-3" style="padding-top: 17px;">
                    <a class="btn btn-primary" style="background-color: #2C75E8;width: 64px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;" @click="downloadWj">下载</a>
                    <a class="btn btn-default" style="width: 64px;height: 25px;color: #888888;border-radius:2px;padding: 2px;" @click="refreshda">刷新</a>
                </div>
            </div>
            <div style="height: 700px;overflow: auto">
                <div id="tree5"></div>
            </div>
        </div>
        <div class="col-xs-9 right">
            <div class="row" style="height: 54px;border-bottom: 1px solid #E0E0E0">
                <label class="col-xs-4" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px">档案基本信息</label>
                <div class="btn-group col-xs-offset-5 col-xs-1" style="padding-top: 17px;">
                    <a class="btn btn-primary" style="background-color: #2C75E8;width: 118px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px" @click="goback">返回</a>
                </div>
                <div class="btn-group" style="padding-top: 17px;">
                    <a class="btn btn-primary" style="background-color: #2C75E8;width: 118px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;margin-left: 60px;" @click="ckcl" v-show="clButton">查看材料信息</a>
                    <a class="btn btn-primary" style="background-color: #2C75E8;width: 118px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;margin-left: 60px;" @click="ckda" v-show="daButton">查看档案信息</a>
                </div>
            </div>
            <div v-show="da">
                <div class="row">
                    <div class="form-group col-xs-6">
                        <label>档案编号*</label>
                        <input readonly name="dabh" v-model="wsxx.dabh" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>时间</label>
                        <input readonly v-model="wsxx.sj" name="sj" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>文号</label>
                        <input readonly v-model="wsxx.wh" name="wh" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-12">
                        <label>案卷题名*</label>
                        <input readonly v-model="wsxx.wjmc" name="wjmc" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-12">
                        <label>单位名称</label>
                        <input readonly v-model="wsxx.dwmc" name="dwmc" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-6">
                        <label>登记人</label>
                        <input v-model="wsxx.djr" name="djr" type="text" readonly
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-6">
                        <label>登记时间</label>
                        <input v-model="wsxx.inputtime" name="inputtime" type="text" readonly
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>年份*</label>
                        <input readonly v-model="wsxx.nf" name="nf" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>页数</label>
                        <input readonly v-model="wsxx.ys" name="ys" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>总盒号</label>
                        <input readonly v-model="wsxx.zhh" name="zhh" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-3">
                        <label>页号</label>
                        <input readonly v-model="wsxx.yh" name="yh" type="text"
                               class="form-control input-sm">
                    </div>
                    <div class="form-group col-xs-12">
                        <label>备注</label>
                        <textarea readonly v-model="wsxx.bz" name="qzh" type="text" class="form-control input-sm"></textarea>
                    </div>
                    <!--<div class="form-group col-xs-6">-->
                        <!--<label>档案类型</label>-->
                        <!--<input name="typeName" type="text" class="form-control input-sm" v-model="wsxx.typeName"-->
                               <!--readonly>-->
                    <!--</div>-->
                </div>
            </div>
            <div v-show="cl">
                <table class="table table-bordered table-hover text-center" id="daTable2">

                </table>
            </div>
        </div>

    </div>

</div>

<script src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<!-- Slimscroll -->
<script src="/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/plugins/fastclick/fastclick.js"></script>

<!-- AdminLTE App -->
<script src="/static/dist/js/app.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="/static/dist/js/demo.js"></script>
<!--tabs-->
<script src="/static/dist/js/app_iframe.js"></script>
<script src="/static/js/bootstrap-treeview.js"></script>
<script src="/static/js/bootstrapValidator.min.js"></script>
<script src="/static/js/bootstrap-table.min.js"></script>
<script src="/static/js/bootstrap-table-zh-CN.js"></script>
<script src="/static/js/vue.js"></script>
<script src="/static/js/vue-resource.min.js"></script>
<script src="/static/layer/layer.js"></script>
<script src="/static/js/myJs.js?v=shujubuwqd12138"></script>
<script src="/static/js/viewer.min.js"></script>
<script src="/static/js/newJs.js?v=shujubuwqd12138"></script>

<!--<script src="/static/js/jquery-viewer.js"></script>-->

<script type="text/javascript">
    newCss("/static/webCss/ckwsda.css");
    var id;
    var viewer2;
    //键盘按下
    var kdLxNodes;
    var kdid;
    var kdId;
    var kdtreeNum;
    function paramsMatter(value,row,index) {
        var span=document.createElement('span');
        span.setAttribute('title',value);
        span.innerHTML = value;
        return span.outerHTML;
    }
    var nextid;
    var preid;
    var Id;
    var ids = new Array();
    //记录节点id；
    var nodeId;
    var nodeId2;
    //记录节点的个数
    var index;
    var nodeCheckedSilent = false;

    window.document.onkeydown = isSearch;
    function isSearch(event) {
        var keynum;
        var keychar;
        var numcheck;

        if(window.event) // IE
        {
            keynum = event.keyCode
        } else if(event.which) // Netscape/Firefox/Opera
        {
            keynum = event.which
        }
        if(keynum === 37){
            if(kdtreeNum == 2){
                viewer2.destroy();
            }else if(kdtreeNum == 3){
                viewer.destroy();
            }
            openpre(kdLxNodes,kdid,0,kdtreeNum);
        }else if(keynum === 39){
            if(kdtreeNum == 2){
                viewer2.destroy();
            }else if(kdtreeNum == 3){
                viewer.destroy();
            }
            opennext(kdLxNodes,kdid,0,kdtreeNum);
        }
    }

    function nodeChecked(event, node) {
        if (nodeCheckedSilent) {
            return;
        }
        nodeCheckedSilent = true;
        checkAllParent(node);
        checkAllSon(node);
        nodeCheckedSilent = false;
    }

    var nodeUncheckedSilent = false;

    function nodeUnchecked(event, node) {
        if (nodeUncheckedSilent)
            return;
        nodeUncheckedSilent = true;
        uncheckAllParent(node);
        uncheckAllSon(node);
        nodeUncheckedSilent = false;
    }

    //选中全部父节点
    function checkAllParent(node) {
        $('#tree').treeview('checkNode', node.nodeId, {
            silent: true
        });
        var parentNode = $('#tree').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        } else {
            checkAllParent(parentNode);
        }
    }
    //取消全部父节点
    function uncheckAllParent(node) {
        $('#tree').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        var siblings = $('#tree').treeview('getSiblings', node.nodeId);
        var parentNode = $('#tree').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        }
        var isAllUnchecked = true; //是否全部没选中
        for (var i in siblings) {
            if (siblings[i].state.checked) {
                isAllUnchecked = false;
                break;
            }
        }
        if (isAllUnchecked) {
            uncheckAllParent(parentNode);
        }

    }

    //级联选中所有子节点
    function checkAllSon(node) {
        $('#tree').treeview('checkNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                checkAllSon(node.nodes[i]);
            }
        }
    }
    //级联取消所有子节点
    function uncheckAllSon(node) {
        $('#tree').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                uncheckAllSon(node.nodes[i]);
            }
        }
    }



    var nodeCheckedSilent2 = false;

    function nodeChecked2(event, node) {
        if (nodeCheckedSilent2) {
            return;
        }
        nodeCheckedSilent2 = true;
        checkAllParent2(node);
        checkAllSon2(node);
        nodeCheckedSilent2 = false;
    }

    var nodeUncheckedSilent2 = false;

    function nodeUnchecked2(event, node) {
        if (nodeUncheckedSilent2)
            return;
        nodeUncheckedSilent2 = true;
        uncheckAllParent2(node);
        uncheckAllSon2(node);
        nodeUncheckedSilent2 = false;
    }

    //选中全部父节点
    function checkAllParent2(node) {
        $('#tree5').treeview('checkNode', node.nodeId, {
            silent: true
        });
        var parentNode = $('#tree5').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        } else {
            checkAllParent2(parentNode);
        }
    }
    //取消全部父节点
    function uncheckAllParent2(node) {
        $('#tree5').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        var siblings = $('#tree5').treeview('getSiblings', node.nodeId);
        var parentNode = $('#tree5').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        }
        var isAllUnchecked2 = true; //是否全部没选中
        for (var i in siblings) {
            if (siblings[i].state.checked) {
                isAllUnchecked2 = false;
                break;
            }
        }
        if (isAllUnchecked2) {
            uncheckAllParent2(parentNode);
        }

    }

    //级联选中所有子节点
    function checkAllSon2(node) {
        $('#tree5').treeview('checkNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                checkAllSon2(node.nodes[i]);
            }
        }
    }
    //级联取消所有子节点
    function uncheckAllSon2(node) {
        $('#tree5').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                uncheckAllSon2(node.nodes[i]);
            }
        }
    }
    //打开上一张图片
    /*
    nowId为选择的节点id,
    ids为图片数组
    Id为借阅id
    treeNum分辨哪个treeview
     */
    function openpre(lxNodes,id,Id,treeNum) {
        preid = id;
        var upanddownImgVo = {
            'id':id,
            'type':0,
            'lxNodes':lxNodes,
        };
        $.ajax({
            url: '/jy/api/upanddownImg',
            type: 'post',
            dataType:'JSON',
            data: JSON.stringify(upanddownImgVo),
            cache: false,
            contentType: 'application/json; charset=UTF-8',
            processData: false,
            //dataType: "json",
            async: false,
            success: function (result) {
                if(result.code == 200){
                    var id = result.data;
                    preid = id;
                    kdid = id;
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,id,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,id,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,id,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,id,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }else {
                    cxAlertts("已经是第一张");
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+preid+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,preid,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,preid,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+preid+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,preid,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,preid,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }
            }
        });
    }
    //打开下一张
    function opennext(lxNodes,id,Id,treeNum) {
        nextid = id;
        var upanddownImgVo = {
            'id':id,
            'type':1,
            'lxNodes':lxNodes,
        };
        $.ajax({
            url: '/jy/api/upanddownImg',
            type: 'post',
            dataType:'JSON',
            data: JSON.stringify(upanddownImgVo),
            cache: false,
            contentType: 'application/json; charset=UTF-8',
            processData: false,
            //dataType: "json",
            async: false,
            success: function (result) {
                if(result.code == 200){
                    var id = result.data;
                    nextid = id;
                    kdid = id;
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,id,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,id,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,id,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,id,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }else {
                    cxAlertts("已经是最后一张");
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+nextid+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,nextid,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,nextid,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+nextid+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,nextid,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,nextid,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }
            }
        });
    }

    function printWj(){
        var nodes;
        nodes = $('#tree').treeview('getChecked');
        if("context" in nodes){
            nodes = $('#tree5').treeview('getChecked');
        }
        for(var i = 0;i < nodes.length;i++){
            var id = nodes[i].id;
            if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                //id = encodeURIComponent(id);
                //id = id.replace(/%2F/g,"/")
                //const src = '<img src='+ "C:\\Users\\MSK\\Desktop\\192132n2cpkeoak8e9266p.jpg" + '>';
                const src = '<img src='+ id + '>';
                var url = '/jy/api/getImg?path='+id+'&jyId='+Id;
                var newwindow = window.open(url);
                if(newwindow){
                    // newwindow.document.open();
                    // newwindow.document.write(src);
                    // newwindow.document.close();
                    newwindow.print();
                    //newwindow.close();
                }
            }else if(id.indexOf(".pdf")!=-1){
                id = decodeURIComponent(id);
                var u ="/jy/api/getPdf/"+id+"/"+Id;
                var pdfwindow = window.open(u);
                pdfwindow.print();
            }
        }

    }
    function downloadWj(){
        var ids = new Array();
        var nodes;
        nodes = $('#tree').treeview('getChecked');
        if("context" in nodes){
            nodes = $('#tree5').treeview('getChecked');
        }
        if(nodes.length == 0){
            cxAlert("请先选择要下载的文件");
            return;
        }
        for(var i = 0;i < nodes.length;i++){
            var id = nodes[i].id;
            ids[i] = id;
        }
        var data = {"ids":ids,"jyId":Id}
        var url = "/jy/api/download?ids="+ids+"&jyId="+Id;
        window.open(url);
        // var url = '/jy/api/download';
        //
        // var formStr = '<form style="visibility:hidden;" method="POST" action="' + url + '">' +
        //     '<input type="hidden" name="ids" value="' + encodeURIComponent(ids) + '" />' +
        //     '<input type="hidden" name="jyId" value="' + encodeURIComponent(Id) + '" />'+
        //     '</form>';
        //
        // var win = window.open(url);
        // win.document.body.innerHTML = formStr;
        // win.document.forms[0].submit();
        cxAlertOk("下载成功")
    }
    var vue = new Vue({
        el: '#yhgl',
        data: {
            isWdjy:false,
            clButton:true,
            daButton:false,
            cl:false,
            da:true,
            first:true,
            second:false,
            third:false,
            allShy:null,
            role:null,
            keyword:null,
            gdxx: {
                typeName:null,
                type_name:null,//
                id:null,
                typeId:null,//
                dabh:null,
                xmbh:null,
                xmmc:null,
                year:null,
                dtslbh:null,//大厅受理编号
                yhh:null,//原盒号
                jsdw:null,//建设单位
                jswz:null,//建设位置
                jsxmxzyjssj:null,//建设项目选址意见书时间
                xzxmmc:null,//选址项目名称
                xzydmj:null,//选址用地面积
                jsydghxkzsj:null,//建设用地规划许可证时间
                ghxmmc:null,//规划项目名称
                ghydmj:null,//规划用地面积
                jsgcghxkzsj:null,//建设工程规划许可证时间
                gcxmmc:null,//工程项目名称
                gcjsgm:null,//工程建设规模
                jsgcjgghyshgsj:null,//建设工程竣工规划验收合格证时间
                gcjgxmmc:null,//工程竣工项目名称
                gcjgjsgm:null,//工程竣工建设规模
                jsgcsgxkzsj:null,//建设工程施工许可证时间
                jsgcsgxkzbh:null,//建设工程施工许可证编号
                sggcmc:null,//施工工程名称
                sgjsgm:null,//施工建设规模
                qt:null,//其他
                xmfatgsj:null,//项目通过时间
                ys:null,//页数
                daccwz:null,//档案存储位置
                clj:null,//超链接
                zly:null,//著录员
                zlsj:null,//著录时间
                bz:null,//备注
            },
            wsxx:{
                djr:null,
                inputtime:null,
                bz:null,
                jyId:null,
                //files:[],
                id:null,
                typeId:null,
                dabh:null,//档案编号
                dwmc:null,//单位名称
                nf:null,//年份
                sj:null,//时间
                typeName:null,
                wh:null,//文号
                wjmc:null,//文件名称
                yh:null,//页号
                ys:null,//页数
                zhh:null,//总盒号
            },
        },
        methods: {
            goback:function(){
                if(this.isWdjy){
                    top.addTabs({
                        id: "7777",
                        text: "档案借阅",
                        icon: "fa fa-circle-o",
                        url: "wdjy?type=0&"+this.otherUrl,
                        targetType: "iframe-tab",
                        close:true
                    });
                }else{
                    top.addTabs({
                        id: "90082",
                        text: "我的借阅",
                        icon: "fa fa-circle-o",
                        url: "sc",
                        targetType: "iframe-tab",
                        close:true
                    });
                }
            },
            //查看材料信息
            ckcl:function(){
                this.cl = true;
                this.da = false;
                this.clButton = false;
                this.daButton = true;
            },
            //查看档案信息
            ckda:function(){
                this.cl = false;
                this.da = true;
                this.daButton = false;
                this.clButton = true;
            },
            //刷新
            refreshda:function () {
                var myMsg = cxLoad("刷新中");
                $.get("/jy/api/queryJyClxx?id=" + Id, function (result) {
                    if (result.code == 200) {
                        layer.close(myMsg);
                        var data = result.data;
                        var lxNodes = data.lxNodes;
                        kdLxNodes = data.lxNodes;
                        if(data.daxx == undefined){
                            kdtreeNum = 3;
                            var dah = data.daxxWs.dabh;
                            var clxxName = data.daxxWs.typeName;
                            var keys = Object.keys(data.daxxWs);
                            for(var i = 0;i < keys.length;i++){
                                var key = keys[i];
                                if(data.daxxWs[key] == 'null'){
                                    data.daxxWs[key] ="";
                                }
                            }
                            //console.log(Object.keys(data.daxxWs));
                            vue.$data.wsxx = data.daxxWs;
                            if(data.lxNodes[0].nodes == null){
                                $('#tree5').treeview({
                                    color: "#428bca",
                                    collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                    // nodeIcon: "glyphicon glyphicon-user",
                                    emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                    expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                    highlightSearchResults: true,//是否高亮搜索结果 默认true
                                    highlightSelected: true,     //是否选中高亮显示
                                    onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                    levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                    showBorder: true,                //是否显示边框
                                    data: data.lxNodes,
                                    showCheckbox: true,
                                    multiSelect: false,
                                    onNodeChecked: nodeChecked2,
                                    onNodeUnchecked: nodeUnchecked2,
                                    onNodeSelected: function (event, data) {
                                        var id = data.id;
                                        kdid = data.id;
                                        id = decodeURIComponent(id);
                                        id =  id.toLowerCase();

                                        if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                            $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                            viewer = new Viewer(document.getElementById('tree3'), {
                                                inline: true,
                                                url: 'dataUrl',
                                                //navbar: false,
                                                zIndexInline: 9999,
                                                button: true,
                                                fullscreen:false,
                                                backdrop: true,
                                                keyboard:true,
                                                navbar:false,
                                                toolbar: {
                                                    zoomIn: {
                                                        show: 1,
                                                        click: function () {
                                                            viewer.destroy();
                                                        }
                                                    },
                                                    zoomOut: 0,
                                                    oneToOne: 0,
                                                    reset: 0,
                                                    prev: {
                                                        show:1,
                                                        click: function(){
                                                            viewer.destroy();
                                                            openpre(lxNodes,data.id,Id,3)
                                                        }

                                                    },
                                                    next: {
                                                        show:1,
                                                        click: function(){
                                                            viewer.destroy();
                                                            opennext(lxNodes,data.id,Id,3)
                                                        }

                                                    },
                                                    rotateLeft: 1,
                                                    rotateRight: 1,
                                                    flipHorizontal: 0,
                                                    flipVertical: 0,
                                                },
                                            });
                                        }else if(id.indexOf(".pdf")!=-1){
                                            var u = "/jy/api/getPdf/"+id+"/"+Id;

                                            top.addTabs({
                                                id: "63233",
                                                text: "PDF浏览器",
                                                icon: "fa fa-circle-o",
                                                url: "/static/pdf/web/viewer.html?file="+u,
                                                targetType: "iframe-tab",
                                                close:true
                                            });
                                        }

                                    }
                                });
                            }else {
                                $('#tree5').treeview({
                                    color: "#428bca",
                                    collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                    // nodeIcon: "glyphicon glyphicon-user",
                                    emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                    expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                    highlightSearchResults: true,//是否高亮搜索结果 默认true
                                    highlightSelected: true,     //是否选中高亮显示
                                    onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                    levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                    showBorder: true,                //是否显示边框
                                    data: data.lxNodes,
                                    showCheckbox: true,
                                    multiSelect: false,
                                    onNodeChecked: nodeChecked2,
                                    onNodeUnchecked: nodeUnchecked2,
                                    onNodeSelected: function (event, data) {
                                        var id = data.id;
                                        kdid = data.id;
                                        id = decodeURIComponent(id);
                                        id =  id.toLowerCase();

                                        if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                            $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                            viewer = new Viewer(document.getElementById('tree3'), {
                                                inline: true,
                                                url: 'dataUrl',
                                                //navbar: false,
                                                zIndexInline: 9999,
                                                button: true,
                                                fullscreen:false,
                                                backdrop: true,
                                                keyboard:true,
                                                navbar:false,
                                                toolbar: {
                                                    zoomIn: {
                                                        show: 1,
                                                        click: function () {
                                                            viewer.destroy();
                                                        }
                                                    },
                                                    zoomOut: 0,
                                                    oneToOne: 0,
                                                    reset: 0,
                                                    prev: {
                                                        show:1,
                                                        click: function(){
                                                            viewer.destroy();
                                                            openpre(lxNodes,data.id,Id,3)
                                                        }

                                                    },
                                                    next: {
                                                        show:1,
                                                        click: function(){
                                                            viewer.destroy();
                                                            opennext(lxNodes,data.id,Id,3)
                                                        }

                                                    },
                                                    rotateLeft: 1,
                                                    rotateRight: 1,
                                                    flipHorizontal: 0,
                                                    flipVertical: 0,
                                                },
                                            });
                                        }else if(id.indexOf(".pdf")!=-1){
                                            var u = "/jy/api/getPdf/"+id+"/"+Id;
                                            top.addTabs({
                                                id: "63233",
                                                text: "PDF浏览器",
                                                icon: "fa fa-circle-o",
                                                url: "/static/pdf/web/viewer.html?file="+u,
                                                targetType: "iframe-tab",
                                                close:true
                                            });
                                        }

                                    }
                                });
                            }
                        }else{
                            kdtreeNum = 2;
                            var keys2 = Object.keys(data.daxx);
                            for(var j = 0;j < keys2.length;j++){
                                var key2 = keys2[j];
                                if(data.daxx[key2] == 'null'){
                                    data.daxx[key2] ="";
                                }
                            }
                            vue.$data.gdxx = data.daxx;
                            var jyId = data.daxx.id;
                            if(data.lxNodes[0].nodes == null){
                                $('#tree').treeview({
                                    color: "#428bca",
                                    collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                    // nodeIcon: "glyphicon glyphicon-user",
                                    emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                    expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                    highlightSearchResults: true,//是否高亮搜索结果 默认true
                                    highlightSelected: true,     //是否选中高亮显示
                                    onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                    levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                    showBorder: true,                //是否显示边框
                                    data: data.lxNodes,
                                    showCheckbox: true,
                                    multiSelect: false,
                                    onNodeChecked: nodeChecked,
                                    onNodeUnchecked: nodeUnchecked,
                                    onNodeSelected: function (event, data) {
                                        var id = data.id;
                                        kdid = data.id;
                                        id = decodeURIComponent(id);
                                        id =  id.toLowerCase();
                                        if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                            $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                            viewer2 = new Viewer(document.getElementById('tree2'), {
                                                inline: true,
                                                url: 'dataUrl',
                                                //navbar: false,
                                                zIndexInline: 9999,
                                                button: true,
                                                backdrop: true,
                                                navbar:false,
                                                fullscreen:false,
                                                toolbar: {
                                                    zoomIn: {
                                                        show: 1,
                                                        click: function () {
                                                            viewer2.destroy();
                                                        }
                                                    },
                                                    zoomOut: 0,
                                                    oneToOne: 0,
                                                    reset: 0,
                                                    prev: {
                                                        show:1,
                                                        click: function(){
                                                            viewer2.destroy();
                                                            openpre(lxNodes,data.id,Id,2)
                                                        }

                                                    },
                                                    next: {
                                                        show:1,
                                                        click: function(){
                                                            viewer2.destroy();
                                                            opennext(lxNodes,data.id,Id,2)
                                                        }
                                                    },
                                                    rotateLeft: 1,
                                                    rotateRight: 1,
                                                    flipHorizontal: 0,
                                                    flipVertical: 0,
                                                },
                                            });
                                        }else if(id.indexOf(".pdf")!=-1){
                                            var u = "/jy/api/getPdf/"+id+"/"+Id;
                                            top.addTabs({
                                                id: "63233",
                                                text: "PDF浏览器",
                                                icon: "fa fa-circle-o",
                                                url: "/static/pdf/web/viewer.html?file="+u,
                                                targetType: "iframe-tab",
                                                close:true
                                            });
                                        }

                                    }
                                });
                            }else{
                                $('#tree').treeview({
                                    color: "#428bca",
                                    collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                    // nodeIcon: "glyphicon glyphicon-user",
                                    emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                    expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                    highlightSearchResults: true,//是否高亮搜索结果 默认true
                                    highlightSelected: true,     //是否选中高亮显示
                                    onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                    levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                    showBorder: true,                //是否显示边框
                                    data: data.lxNodes,
                                    showCheckbox: true,
                                    multiSelect: false,
                                    onNodeChecked: nodeChecked,
                                    onNodeUnchecked: nodeUnchecked,
                                    onNodeSelected: function (event, data) {
                                        var id = data.id;
                                        kdid = data.id;
                                        id = decodeURIComponent(id);
                                        id =  id.toLowerCase();
                                        if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                            $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                            viewer2 = new Viewer(document.getElementById('tree2'), {
                                                inline: true,
                                                url: 'dataUrl',
                                                //navbar: false,
                                                zIndexInline: 9999,
                                                button: true,
                                                backdrop: true,
                                                navbar:false,
                                                fullscreen:false,
                                                toolbar: {
                                                    zoomIn: {
                                                        show: 1,
                                                        click: function () {
                                                            viewer2.destroy();
                                                        }
                                                    },
                                                    zoomOut: 0,
                                                    oneToOne: 0,
                                                    reset: 0,
                                                    prev: {
                                                        show:1,
                                                        click: function(){
                                                            viewer2.destroy();
                                                            openpre(lxNodes,data.id,Id,2)
                                                        }

                                                    },
                                                    next: {
                                                        show:1,
                                                        click: function(){
                                                            viewer2.destroy();
                                                            opennext(lxNodes,data.id,Id,2)
                                                        }

                                                    },
                                                    rotateLeft: 1,
                                                    rotateRight: 1,
                                                    flipHorizontal: 0,
                                                    flipVertical: 0,
                                                },
                                            });
                                        }else if(id.indexOf(".pdf")!=-1){
                                            var u = "/jy/api/getPdf/"+id+"/"+Id;
                                            top.addTabs({
                                                id: "63233",
                                                text: "PDF浏览器",
                                                icon: "fa fa-circle-o",
                                                url: "/static/pdf/web/viewer.html?file="+u,
                                                targetType: "iframe-tab",
                                                close:true
                                            });
                                        }

                                    }
                                });
                            }
                        }
                    }else{
                        layer.close(myMsg);
                        cxAlert(result.mess)
                    }
                });
            }
        },
        created: function () {
            $.get('/getUser').then( function (result) {
                var data = result.data;
                if(result.code == 200){
                    vue.$data.role = data.roleId;
                }
            });
            this.$http.get('/listShUser').then( function (result) {
                var data = result.body;
                if(data.code == 200){
                    this.allShy = data.data;
                }else{
                    cxAlert(data.mess);
                }
            })
        },
        mounted: function () {
            try {
                top.activeTabByPageId(7777);
                top.closeTabByPageId(7777);
                top.activeTabByPageId(19001112);
            }catch (e) {
                //console.log(e)
                top.activeTabByPageId(19001112);
            }
            var that = this;
            var url = location.search;
            if(url.indexOf('keyword') != -1){
                that.isWdjy = true;
                id = url.substring(0,url.indexOf("&"));
                id = id.substring(id.indexOf("=")+1);
                var url2 = url.substring(url.indexOf("&")+1);
                var dabh = url2.substring(0,url.indexOf("&"));
                dabh = dabh.substring(dabh.indexOf("=")+1);
                that.otherUrl = url2.substring(url2.indexOf("&")+1);
                Id = id;
            }else {
                id = url.substring(0,url.indexOf("&"));
                id = id.substring(id.indexOf("=")+1);
                Id = id;
            }
            var url2 = url.substring(url.indexOf("&")+1);
            var dabh = url2.substring(url2.indexOf("=")+1)
            $.get("/jy/api/queryJyClxx?id=" + Id, function (result) {
                if (result.code == 200) {

                    var data = result.data;
                    var lxNodes = data.lxNodes;
                    kdLxNodes = data.lxNodes;
                    if(data.daxx == undefined){
                        kdtreeNum = 3;
                        var dah = data.daxxWs.dabh;
                        var clxxName = data.daxxWs.typeName;
                        var keys = Object.keys(data.daxxWs);
                        for(var i = 0;i < keys.length;i++){
                            var key = keys[i];
                            if(data.daxxWs[key] == 'null'){
                                data.daxxWs[key] ="";
                            }
                        }
                        //console.log(Object.keys(data.daxxWs));
                        vue.$data.wsxx = data.daxxWs;
                        if(data.lxNodes[0].nodes == null){
                            $('#tree5').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                showCheckbox: true,
                                multiSelect: false,
                                onNodeChecked: nodeChecked2,
                                onNodeUnchecked: nodeUnchecked2,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();

                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer = new Viewer(document.getElementById('tree3'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            fullscreen:false,
                                            backdrop: true,
                                            keyboard:true,
                                            navbar:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer.destroy();
                                                        openpre(lxNodes,data.id,Id,3)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer.destroy();
                                                        opennext(lxNodes,data.id,Id,3)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;

                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }else {
                            $('#tree5').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                showCheckbox: true,
                                multiSelect: false,
                                onNodeChecked: nodeChecked2,
                                onNodeUnchecked: nodeUnchecked2,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();

                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer = new Viewer(document.getElementById('tree3'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            fullscreen:false,
                                            backdrop: true,
                                            keyboard:true,
                                            navbar:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer.destroy();
                                                        openpre(lxNodes,data.id,Id,3)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer.destroy();
                                                        opennext(lxNodes,data.id,Id,3)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }
                    }else{
                        kdtreeNum = 2;
                        var keys2 = Object.keys(data.daxx);
                        for(var j = 0;j < keys2.length;j++){
                            var key2 = keys2[j];
                            if(data.daxx[key2] == 'null'){
                                data.daxx[key2] ="";
                            }
                        }
                        vue.$data.gdxx = data.daxx;
                        var jyId = data.daxx.id;
                        if(data.lxNodes[0].nodes == null){
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                showCheckbox: true,
                                multiSelect: false,
                                onNodeChecked: nodeChecked,
                                onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }
                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }else{
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                showCheckbox: true,
                                multiSelect: false,
                                onNodeChecked: nodeChecked,
                                onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }
                    }
                }else{
                    cxAlert(result.mess)
                }
            });

            $("#daTable2").bootstrapTable('destroy');
            $('#daTable2').bootstrapTable({
                url: '/dalr/api/queryDabhClxx?dabh='+dabh,
                contentType: "application/json; charset=UTF-8",
                type: "GET",
                dataType: 'json',
                queryParamsType: "",
                singleSelect: true,
                paginationShowPageGo: true,
                pageNumber:1,
                pageSize:5,
                // queryParams: function (params) {
                //     return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                // },
                striped: true,
                smartDisplay:false,
                cache: false,
                //pagination: true,
                pageList: [5,10],
                sidePagination: 'server',
                toolbar: "#addtool",
                columns: [
                    {
                        title: '档案类型',
                        field:'typeName',
                        formatter:paramsMatter
                    },{
                        field: 'dabh',
                        title: '档案编号',
                        formatter:paramsMatter
                    },
                    {
                        title: '文件序号',
                        field:'wjxh',
                        formatter:paramsMatter
                    },{
                        field: 'clmc',
                        title: '材料名称',
                        formatter:paramsMatter
                    },{
                        field: 'qsym',
                        title: '起始页码',
                        formatter:paramsMatter
                    },
                    {
                        title: '终止页码',
                        field:'zzym',
                        formatter:paramsMatter
                    },{
                        field: 'ys',
                        title: '页数',
                        formatter:paramsMatter
                    }
                    // ,{
                    //     title: '操作',
                    //     formatter: function (value, row, index) {
                    //         console.log(value)
                    //         var aStr = '<a class="btn-primary btn" href="javascript:bj('+row.id+',\''+row.dabh+'\',\''+row.typeName+'\')">编辑</a>';
                    //         // aStr += '<a class="btn-success btn" href="javascript:tj('+row.id+')">添加</a>';
                    //         aStr += '<a class="btn-danger btn" href="javascript:sccl('+row.id+')">删除</a>';
                    //         return aStr;
                    //     }
                    // }
                    ],
                responseHandler: function (res) {  //后台返回的结果
                    if (res.code == "200") {
                        var data = res.data;
                        vue.$data.length2 = data.length;
                        var NewData = [];
                        for(i=0;i<data.length;i++){
                            var dd = data[i];
                            dd.roleName = roleId2RoleName(dd.roleId);
                            NewData.push(dd);
                        }
                        var data = {
                            total: res.data.total,
                            rows: NewData
                        };
                        return data;
                    }
                }
            });

        }
    });


</script>

</body>
</html>
